/*
 * key_led.h
 *
 *  Created on: Aug 18, 2023
 *      Author: dk007
 */

#ifndef INCLUDE_KEY_LED_H_
#define INCLUDE_KEY_LED_H_

#include "user_config.h"
#include "stdint.h"

#define LED_1_ON()      GPIO_ResetBits(LED_1_PORT, LED_1_PIN)
#define LED_1_OFF()     GPIO_SetBits(LED_1_PORT, LED_1_PIN)
#define LED_2_ON()      GPIO_ResetBits(LED_2_PORT, LED_2_PIN)
#define LED_2_OFF()     GPIO_SetBits(LED_2_PORT, LED_2_PIN)
#define LED_3_ON()      GPIO_ResetBits(LED_3_PORT, LED_3_PIN)
#define LED_3_OFF()     GPIO_SetBits(LED_3_PORT, LED_3_PIN)

#define LED_4_ON()      GPIO_ResetBits(LED_4_PORT, LED_4_PIN)
#define LED_4_OFF()     GPIO_SetBits(LED_4_PORT, LED_4_PIN)
#define LED_5_ON()      GPIO_ResetBits(LED_5_PORT, LED_5_PIN)
#define LED_5_OFF()     GPIO_SetBits(LED_5_PORT, LED_5_PIN)
#define LED_6_ON()      GPIO_ResetBits(LED_6_PORT, LED_6_PIN)
#define LED_6_OFF()     GPIO_SetBits(LED_6_PORT, LED_6_PIN)

#define LED_7_ON()      GPIO_ResetBits(LED_7_PORT, LED_7_PIN)
#define LED_7_OFF()     GPIO_SetBits(LED_7_PORT, LED_7_PIN)
#define LED_8_ON()      GPIO_ResetBits(LED_8_PORT, LED_8_PIN)
#define LED_8_OFF()     GPIO_SetBits(LED_8_PORT, LED_8_PIN)
#define LED_9_ON()      GPIO_ResetBits(LED_9_PORT, LED_9_PIN)
#define LED_9_OFF()     GPIO_SetBits(LED_9_PORT, LED_9_PIN)

#define LED_10_ON()      GPIO_ResetBits(LED_10_PORT, LED_10_PIN)
#define LED_10_OFF()     GPIO_SetBits(LED_10_PORT, LED_10_PIN)
#define LED_11_ON()      GPIO_ResetBits(LED_11_PORT, LED_11_PIN)
#define LED_11_OFF()     GPIO_SetBits(LED_11_PORT, LED_11_PIN)
#define LED_12_ON()      GPIO_ResetBits(LED_12_PORT, LED_12_PIN)
#define LED_12_OFF()     GPIO_SetBits(LED_12_PORT, LED_12_PIN)

uint16_t led_ProcessEvent(uint8_t task_id, uint16_t events);

#if USER_LED_EN
void led_all_on(void);
void array_led_gpio_init(void);
void key_led_on_by_single(uint8_t key);
void key_led_on_by_prying_mode(void);
void key_led_on_by_water_lamp(uint8_t index);
void key_led_water_lamp(uint8_t index);
void led_prying_mode(void);
void led_charge_indicate_mode(uint8_t index);
void set_led_charte_indicate_evt(void);
void stop_led_charte_indicate_evt(void);
void set_hardware_recovery_blink_mode(void);
void led_timer_init(void);
void led_timer_uninit(void);
#else
#define led_of_key_init(...)
#define led_all_on(...)
#define led_all_off(...)
#define led_timer_init(...)
#define set_hardware_recovery_blink_mode(...)
#define display_key_and_mode_set(...)
#define led_timer_uninit(...)
#define set_led_charte_indicate_evt(...)
#define stop_led_charte_indicate_evt(...)
#define led_charge_indicate_mode(...)
#endif

#if USER_DIGITAL_TUBE_EN
void led_of_battery_init(void);
void battery_led_timer_uninit(void);
void led_of_battery_dis(uint8_t persent);
#endif
#endif /* INCLUDE_KEY_LED_H_ */
